package org.shoukaiseki.commons.utils.sql;

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;

/**
 * <br>
 *
 * @author 蒋カイセキ    Japan-Tokyo  18-10-23 下午8:34<br>
 * ブログ http://www.shoukaiseki.top/<br>
 * E-メール jiang28555@Gmail.com<br>
 **/
public class PrintResultSet {

    public static void printSingle(ResultSet resultSet) throws SQLException {
        ResultSetMetaData metaData = resultSet.getMetaData();
        for (int i = 1; i <= metaData.getColumnCount(); i++) {
            System.out.print("ColumnName="+metaData.getColumnName(i));
            System.out.print(",ColumnLabel="+metaData.getColumnLabel(i));
            System.out.print(",CatalogName="+metaData.getCatalogName(i));
            System.out.print(",ColumnClassName="+metaData.getColumnClassName(i));
            System.out.print(",value="+ resultSet.getString(i));
            System.out.println();

        }

    }

}
